<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>工程文档管理</title>
    <!--<script th:src="@{/ckfinder.js}"></script>-->
    <script type="text/javascript" src="ckfinder/ckfinder.js"></script>
    <style type="text/css">
        #document {
            width: auto;
            min-width: 1000px;
            padding: 20px 25px 10px 25px;
            height: 100%;
            overflow: auto;
            color: #333;
        }
        body, html, iframe{
            margin: 0;
            padding: 0;
            border: 0;
            width: 100%;
            height: 100%;
            overflow: hidden;
        }
        #ckfinder{
            margin: 0;
            padding: 0;
            border: 0;
            width: 100%;
            height: calc(100% - 50px);
            overflow: hidden;
        }
        .content-title{
            color: #333;
            font-size: 14px;
            padding-bottom: 30px;
        }
    </style>
</head>
<body class="CKFinderFrameWindow">
    <div th:fragment="main" id="document">
        <div class="content-title">
            <p><span>工程文档管理</span>&nbsp;>&nbsp;<span>文件管理</span></p>
        </div>
        <!--<link rel="stylesheet" th:href="@{/assets/jqGrid/css/jqgridReset.css}">-->
            <div id="ckfinder">
                <!--<script th:src="@{/ckfinder/ckfinder.js}"></script>-->
                <script type="text/javascript">
                (function()
                {
                var config = {};
                var get = CKFinder.tools.getUrlParam;
                var getBool = function( v )
                {
                var t = get( v );

                if ( t === null )
                return null;

                return t == '0' ? false : true;
                };

                var tmp;
                if ( tmp = get( 'configId' ) )
                {
                var win = window.opener || window;
                try
                {
                while ( ( !win.CKFinder || !win.CKFinder._.instanceConfig[ tmp ] ) && win != window.top )
                win = win.parent;

                if ( win.CKFinder._.instanceConfig[ tmp ] )
                config = CKFINDER.tools.extend( {}, win.CKFinder._.instanceConfig[ tmp ] );
                }
                catch(e) {}
                }

                if ( tmp = get( 'startupPath' ) || get( 'start' ) )
                config.startupPath = decodeURIComponent( tmp );

                config.id = get( 'id' ) || '';

                if ( ( tmp = getBool( 'rlf' ) ) !== null )
                config.rememberLastFolder = tmp;

                if ( ( tmp = getBool( 'dts' ) ) !== null )
                config.disableThumbnailSelection = tmp;

                if ( tmp = get( 'data' ) )
                config.selectActionData = tmp;

                if ( tmp = get( 'tdata' ) )
                config.selectThumbnailActionData = tmp;

                if ( tmp = get( 'type' ) )
                config.resourceType = tmp;

                if ( tmp = get( 'langCode' ) )
                config.language = tmp;

                if ( typeof( config.selectActionFunction ) == 'undefined' )
                {
                // Try to get desired "File Select" action from the URL.
                var action;
                if ( tmp = get( 'CKEditor' ) )
                {
                if ( tmp.length )
                action = 'ckeditor';
                }
                if ( !action )
                action = get( 'action' );

                var parentWindow = ( window.parent == window ) ? window.opener : window.parent;
                switch ( action )
                {
                case 'js':
                var actionFunction = get( 'func' );
                if ( actionFunction && actionFunction.length > 0 )
                config.selectActionFunction = parentWindow[ actionFunction ];

                actionFunction = get( 'thumbFunc' );
                if ( actionFunction && actionFunction.length > 0 )
                config.selectThumbnailActionFunction = parentWindow[ actionFunction ];
                break ;

                case 'ckeditor':
                var funcNum = get( 'CKEditorFuncNum' );
                if ( parentWindow['CKEDITOR'] )
                {
                config.selectActionFunction = function( fileUrl, data )
                {
                parentWindow['CKEDITOR'].tools.callFunction( funcNum, fileUrl, data );
                };

                config.selectThumbnailActionFunction = config.selectActionFunction;
                }
                break;

                default:
                if ( parentWindow && parentWindow['FCK'] && parentWindow['SetUrl'] )
                {
                action = 'fckeditor' ;
                config.selectActionFunction = parentWindow['SetUrl'];

                if ( !config.disableThumbnailSelection )
                config.selectThumbnailActionFunction = parentWindow['SetUrl'];
                }
                else
                action = null ;
                }
                config.action = action;
                }

                // Always use 100% width and height when nested using this middle page.
                config.width = config.height ='100%';
                var ckfinder = new CKFinder( config );
                ckfinder.replace( 'ckfinder', config );
                })();
                </script>
                <!--<script th:src="@{/assets/jquerUi/jquery.ui.widget.js}"></script>-->
            </div>
    </div>
</body>
</html>